Skip to content

fix: 지원 가능 대학 모집 인원 nullable 응답 처리#794

Merged
yoonc01 merged 1 commit into
developfrom
fix/nullable-student-capacity-response
Jun 25, 2026
Merged

fix: 지원 가능 대학 모집 인원 nullable 응답 처리#794
yoonc01 merged 1 commit into
developfrom
fix/nullable-student-capacity-response

Conversation

@yoonc01

@yoonc01 yoonc01 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

  • UnivApplyInfo 도메인과 admin 생성/수정 요청에서는 studentCapacity가 nullable한 Integer로 정의되어 있습니다.
  • 엔티티에도 studentCapacitynullable = false 제약이 없어 DB 저장 시 null이 허용되는 구조입니다.
  • 하지만 public 조회 응답 DTO에서는 primitive int로 정의되어 있어, 모집 인원이 없는 데이터 조회 시 언박싱 과정에서 NullPointerException이 발생했습니다.
  • 모집 인원이 아직 미정인 학교도 우선 데이터를 등록한 뒤 추후 admin에서 수정하는 방식으로 운영할 예정이므로, 응답 DTO도 Integer로 타입을 통일하는 것이 적절하다고 판단했습니다.

작업 내용

  • 지원 가능 대학 응답 DTO의 studentCapacity 타입을 int에서 Integer로 변경했습니다.
  • 모집 인원이 null인 지원 가능 대학 조회 시 NullPointerException이 발생하던 문제를 수정했습니다.

@yoonc01 yoonc01 self-assigned this Jun 25, 2026
@yoonc01 yoonc01 added the 버그 Something isn't working label Jun 25, 2026
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

  1. UnivApplyInfoDetailResponsestudentCapacity 타입이 int에서 Integer로 변경되었습니다.
  2. UnivApplyInfoPreviewResponsestudentCapacity 타입이 int에서 Integer로 변경되었습니다.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • Gyuhyeok99
  • wibaek
  • lsy1307
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 모집 인원 nullable 응답 처리라는 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 관련 이슈와 작업 내용이 포함되어 있어 템플릿의 핵심 요구를 충분히 충족합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nullable-student-capacity-response

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/example/solidconnection/university/dto/UnivApplyInfoDetailResponse.java (1)

49-49: 🩺 Stability & Availability | 🟡 Minor

ApplicantsResponse 내의 원시형 int 선언이 여전히 NPE 위험을 안고 있어요. 🧐

안녕하세요! UnivApplyInfostudentCapacity 가 Nullable(Integer) 인 점은 잘 파악하셨죠. 근데 형제 DTO 인 ApplicantsResponse 가 이 값을 받을 때만 또 달라졌어요. 바로 원시형 int 로 받고 있으라네요.

이 채를 그냥 두면, DB 에서 값이 비어 올 때 Integerint 로 감쌈 (Unboxing) 하다가 '짜장면 스크래치'처럼 갑자기 NullPointerException 이 터져버릴 수 있어요. 따라서 같은 맥락에서 Integer 로 정리해 드려요.

  1. 현재 상태ApplicantsResponseint studentCapacity로 선언 중입니다.
  2. 위험 요소null 이 넘어오면 감쌈 처리 중 예외가 발생합니다.
  3. 제안 사항 — 필드 타입을 Integer 로 변경하여 안전성을 확보합니다.
public record ApplicantsResponse(
        String koreanName,
        Integer studentCapacity,
        String region,
        String country,
        List<ApplicantResponse> applicants) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/solidconnection/university/dto/UnivApplyInfoDetailResponse.java`
at line 49, ApplicantsResponse still uses a primitive int for studentCapacity,
which can cause NPE during unboxing when UnivApplyInfo.getStudentCapacity() is
null. Update the ApplicantsResponse record to use Integer for studentCapacity
and keep the mapping in UnivApplyInfoDetailResponse aligned so the value is
passed through without primitive conversion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@src/main/java/com/example/solidconnection/university/dto/UnivApplyInfoDetailResponse.java`:
- Line 49: ApplicantsResponse still uses a primitive int for studentCapacity,
which can cause NPE during unboxing when UnivApplyInfo.getStudentCapacity() is
null. Update the ApplicantsResponse record to use Integer for studentCapacity
and keep the mapping in UnivApplyInfoDetailResponse aligned so the value is
passed through without primitive conversion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f1cc12a3-e6e8-42bf-8e6a-09feae15335f

📥 Commits

Reviewing files that changed from the base of the PR and between d7d866e and 7d3b40c.

📒 Files selected for processing (2)
  • src/main/java/com/example/solidconnection/university/dto/UnivApplyInfoDetailResponse.java
  • src/main/java/com/example/solidconnection/university/dto/UnivApplyInfoPreviewResponse.java

@whqtker whqtker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ! 이런 문제가 있었네요 ...

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

  1. UnivApplyInfoDetailResponsestudentCapacity 타입이 int에서 Integer로 변경되었습니다.
  2. UnivApplyInfoPreviewResponsestudentCapacity 타입이 int에서 Integer로 변경되었습니다.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • Gyuhyeok99
  • wibaek
  • lsy1307
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 모집 인원 nullable 응답 처리라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed 관련 이슈와 작업 내용이 포함되어 있어 템플릿을 전반적으로 충족하며, 일부 항목은 보완 가능하지만 큰 결함은 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nullable-student-capacity-response

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yoonc01 yoonc01 merged commit c695705 into develop Jun 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants